# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        黄周云  
# Name:         question01
# Description:
# Author:       ASUS
# Date:         2019/3/2
#-------------------------------------------------------------------------------


s = input("请输入一个字符串：")
while True:
    subStr = input("请输入需统计在s中的出现次数的字符串：")
    if subStr == "end":
        break
    i = 0
    count =0
    while i<len(s):
        start=s.find(subStr,i)
        if start>=0:
            count+=1
            i=start+len(subStr)
        else:
            break
    print("{a!r}在{b!r}中出现了{c}次".format(a=subStr,b=s,c=count))




